Conservative Ambiguity Detection in Context-Free Grammars
نویسنده
چکیده
The ability to detect ambiguities in context-free grammars is vital for their use in several fields, but the problem is undecidable in the general case. We present a safe, conservative approach, where approximations cannot result in overlooked ambiguous cases. We analyze the complexity of its use, and compare it with other ambiguity detection methods.
منابع مشابه
Ambiguity Detection: Scaling to Scannerless
Static ambiguity detection would be an important aspect of language workbenches for textual software languages. However, the challenge is that automatic ambiguity detection in context-free grammars is undecidable in general. Sophisticated approximations and optimizations do exist, but these do not scale to grammars for so-called “scannerless parsers”, as of yet. We extend previous work on ambig...
متن کاملAmbiguity Detection: Scaling towards Scannerless
Static ambiguity detection would be an important aspect of language workbenches for textual software languages. The challenge is that automatic ambiguity detection of context-free grammars is undecidable. Sophisticated approximations and optimizations do exist, but these do not scale to grammars for so-called “scannerless parsers”, as of yet. We extend previous work on ambiguity detection for c...
متن کاملAnalyzing Ambiguity of Context-Free Grammars
It has been known since 1962 that the ambiguity problem for context-free grammars is undecidable. Ambiguity in context-free grammars is a recurring problem in language design and parser generation, as well as in applications where grammars are used as models of real-world physical structures. We observe that there is a simple linguistic characterization of the grammar ambiguity problem, and we ...
متن کاملDetecting Ambiguity in Programming Language Grammars
Ambiguous Context Free Grammars (CFGs) are problematic for programming languages, as they allow inputs to be parsed in more than one way. In this paper, we introduce a simple non-deterministic search-based approach to ambiguity detection which non-exhaustively explores a grammar in breadth for ambiguity. We also introduce two new techniques for generating random grammars – Boltzmann sampling an...
متن کاملPattern Ambiguities for Pure Context{free Grammars Pattern Ambiguities for Pure Context{free Grammars Pattern Ambiguities for Pure Context{free Grammars
We consider here some special forms of ambiguity for pure context-free grammars, namely pattern avoiding ambiguity, pattern preserving ambiguity, pattern ambiguity, and grammar avoiding ambiguity. The rst two properties are undecidable for arbitrary pure context-free grammars, and in a particular but general enough case we can eeectively decide whether or not a pure context-free grammar is patt...
متن کامل